package com.wandian.setting.mvvm.accountsecurity;

import android.os.Bundle;

import androidx.databinding.DataBindingUtil;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mylib.libcore.config.RouterConfig;
import com.mylib.libcore.mvvm.BaseMVVMActivity;
import com.mylib.libcore.utils.StatusBarUtils;
import com.mylib.libcore.utils.ToastUtil;
import com.wandian.setting.R;
import com.wandian.setting.databinding.SetActivityAccountSecurityBinding;
import com.wandian.setting.databinding.SetActivityBindAccountBinding;

/**
 * @author Administrator
 * @date 2019/12/18-14:28
 * @description 账号安全
 **/
@Route(path = RouterConfig.ROUTER_ACTIVITY_SETTING_ACCOUNT_SECURITY)
public class AccounSecurityActivity extends  BaseMVVMActivity<AccounSecurityViewModel>  {
    private SetActivityAccountSecurityBinding dataBinding;
    @Override
    public void init(Bundle savedInstanceState) {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.set_activity_account_security);
        dataBinding.setLifecycleOwner(this);
        dataBinding.setViewModel(mViewModel);
        initViewData();
        initClink();
    }
    private void initViewData(){
        //设置状态颜色和字体黑色
        StatusBarUtils.with(this,false)
                .setIsActionBar(false)
                .clearActionBarShadow()
                .setDrawable(getResources().getDrawable(com.mylib.libcore.R.drawable.sys_color))
                .init();
        dataBinding.bindSysToolBar.toolBarTvTitle.setText("账号与安全");

        //账号绑定
        dataBinding.bindNextPageText1.tvLeft.setText("账号绑定");
        dataBinding.bindNextPageText1.rlNextPage.setOnClickListener(v -> ARouter.getInstance().build(RouterConfig.ROUTER_ACTIVITY_SETTING_BIND_ACCOUNT).navigation());

        //修改密码
        dataBinding.bindNextPageText2.tvLeft.setText("修改密码");
        dataBinding.bindNextPageText2.rlNextPage.setOnClickListener(v -> ARouter.getInstance().build(RouterConfig.ROUTER_ACTIVITY_SETTING_MODIFY_PASSWORD).navigation());



    }
    private void initClink(){
        dataBinding.bindSysToolBar.toolBarIvBack.setOnClickListener(v -> {
            finishhideSoftBoard();
            finish();
        });

    }


}
